package com.miya.demo.common.annotations;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.miya.demo.common.enums.DataMaskEnum;
import com.miya.demo.config.DataMaskingSerializer;

import java.lang.annotation.*;

/**
 * 数据面具
 *
 * @author CaiXiaowei
 * @date 2023/08/02
 */
@Target({ElementType.FIELD,ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@JacksonAnnotationsInside
@JsonSerialize(using = DataMaskingSerializer.class)
public @interface DataMask {

    DataMaskEnum function() default DataMaskEnum.PHONE;
}
